package com.haierp.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.haierp.enums.GeneralStatus;
import com.haierp.mapper.InventoryListenerMapper;
import com.haierp.model.InventoryListener;
import com.haierp.service.IInventoryListenerService;
import com.haierp.util.DateUtil;

@Service
public class InventoryListenerServiceImpl extends  SuperServiceImpl<InventoryListenerMapper, InventoryListener> implements IInventoryListenerService {


	@Override
	public List<InventoryListener> getInventoryListener(int companyId) {
		EntityWrapper<InventoryListener> entityWrapper = new EntityWrapper<InventoryListener>() ;
		InventoryListener inventoryListener = new InventoryListener();
		inventoryListener.setStatus(GeneralStatus.INIT.getCode());
		inventoryListener.setCompanyId(companyId);
		entityWrapper.setEntity(inventoryListener);
		//只查询今天开始的订单
		entityWrapper.where("gmt_create>={0}", DateUtil.ymdFormat(new Date()));
		List<InventoryListener> listeners = this.baseMapper.selectList(entityWrapper);
		return listeners;
	}
}
